<template>
  <Thumbnail404 v-if="!isFind"></Thumbnail404>
  <div class="live" v-else-if="liveList.length>0">
      <Live
      v-for="live in liveList"
      :key="live._id"
      :live="live"
      ></Live>
  </div>
  <ThumbnailLoading v-else></ThumbnailLoading>
</template>

<script>
import Thumbnail404 from "components/public/Thumbnail404"
import ThumbnailLoading from "components/public/ThumbnailLoading"
import { get } from "util/http"
import Live from "components/search/Live"
export default {
    data(){
        return{
            liveList:[],
            isFind:true
        }
    },
    components:{
        Live,
        ThumbnailLoading,
        Thumbnail404
    },
    async mounted(){
        let result=await get({
            url:"/fm/api/chatroom/search",
            params:{
                q:this.$route.params.keyword,
                p:1,
                page_size:10
            }
        })
        this.liveList=result.info.roomlist
        if(this.liveList.length===0){
            this.isFind=false
        }
    }
}
</script>

<style lang="stylus" scoped>
.live
    display flex
    flex-wrap wrap
    align-items flex-start
    justify-content space-between
    padding .1rem
</style>